﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CastingWellEquipmentGUI.Config
{
    /// <summary>
    /// 线程控制器
    /// </summary>
    public static class ThreadController
    {
        /// <summary>
        /// 圆棒保温炉线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarHoldingFurnaceThreadState;
        /// <summary>
        /// 圆棒流槽线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarLaunderThreadState;
        /// <summary>
        /// 圆棒送丝机线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarWireFeederThreadState;
        /// <summary>
        /// 圆棒除气箱线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarDegassingTankThreadState;
        /// <summary>
        /// 圆棒铸井公辅线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarCastWellPublicAuxiliaryThreadState;
        /// <summary>
        /// 圆棒润滑系统程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarLubricationSystemThreadState;
        /// <summary>
        /// 圆棒铸井公共线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarCastWellPublicThreadState;
        /// <summary>
        /// 圆棒液压系统线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarHydraulicSystemThreadState;
        /// <summary>
        /// 圆棒真值表线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarTruthTableThreadState;
        /// <summary>
        /// 圆棒比例阀线性优化线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarLinearOptimizationOfProportionalValveThreadState;
        /// <summary>
        /// 圆棒供水系统线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarWaterSupplySystemThreadState;
        /// <summary>
        /// 圆棒排水系统线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarDrainageSystemThreadState;
        /// <summary>
        /// 圆棒网络连接线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool RoundBarNetConnectPageThreadState;


        /// <summary>
        /// 扁锭保温炉线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotHoldingFurnaceThreadState;
        /// <summary>
        /// 扁锭流槽线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotLaunderThreadState;
        /// <summary>
        /// 扁锭送丝机线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotWireFeederThreadState;
        /// <summary>
        /// 扁锭除气箱线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotDegassingTankThreadState;
        /// <summary>
        /// 扁锭铸井公辅线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotCastWellPublicAuxiliaryThreadState;
        /// <summary>
        /// 扁锭润滑系统程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotLubricationSystemThreadState;
        /// <summary>
        /// 扁锭铸井公共线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotCastWellPublicThreadState;
        /// <summary>
        /// 扁锭液压系统线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotHydraulicSystemThreadState;
        /// <summary>
        /// 扁锭真值表线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotTruthTableThreadState;
        /// <summary>
        /// 扁锭比例阀线性优化线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotLinearOptimizationOfProportionalValveThreadState;
        /// <summary>
        /// 扁锭供水系统线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotWaterSupplySystemThreadState;
        /// <summary>
        /// 扁锭排水系统线程状态
        /// true为执行线程内方法
        /// false为不执行线程内方法
        /// </summary>
        public static bool FlatIngotDrainageSystemThreadState;
        /// <summary>
        /// 控制线程状态
        /// </summary>
        /// <param name="PageName"></param>
        public static void ControllerThreadState(string PageName)
        {
            #region 圆棒所有线程状态为false
            RoundBarHoldingFurnaceThreadState = false;
            RoundBarLaunderThreadState = false;
            RoundBarWireFeederThreadState = false;
            RoundBarDegassingTankThreadState = false;
            RoundBarCastWellPublicAuxiliaryThreadState = false;
            RoundBarLubricationSystemThreadState = false;
            RoundBarCastWellPublicThreadState = false;
            RoundBarNetConnectPageThreadState = false;
            RoundBarHydraulicSystemThreadState = false;
            RoundBarTruthTableThreadState = false;
            RoundBarLinearOptimizationOfProportionalValveThreadState = false;
            RoundBarWaterSupplySystemThreadState = false;
            RoundBarDrainageSystemThreadState = false;
            #endregion 圆棒所有线程状态为false
            #region 扁锭所有线程状态为false
            FlatIngotHoldingFurnaceThreadState = false;
            FlatIngotLaunderThreadState = false;
            FlatIngotWireFeederThreadState = false;
            FlatIngotDegassingTankThreadState = false;
            FlatIngotCastWellPublicAuxiliaryThreadState = false;
            FlatIngotCastWellPublicThreadState = false;
            FlatIngotHydraulicSystemThreadState = false;
            FlatIngotTruthTableThreadState = false;
            FlatIngotLinearOptimizationOfProportionalValveThreadState = false;
            FlatIngotWaterSupplySystemThreadState = false;
            FlatIngotDrainageSystemThreadState = false;
            #endregion 扁锭所有线程状态为false

            if (SystemConfig.equipmentCategory == "圆棒")
            {
                switch (PageName)
                {

                    case "LaunderPage":
                        RoundBarLaunderThreadState = true;
                        break;
                    case "HoldingFurnacePage":
                        RoundBarHoldingFurnaceThreadState = true;
                        break;
                    case "WireFeederPage":
                        RoundBarWireFeederThreadState = true;
                        break;
                    case "DegassingTankPage":
                        RoundBarDegassingTankThreadState = true;
                        break;
                    case "CastWellPublicAuxiliaryPage":
                        RoundBarCastWellPublicAuxiliaryThreadState = true;
                        break;
                    case "LubricationSystemPage":
                        RoundBarLubricationSystemThreadState = true;
                        break;
                    case "CastWellPublicPage":
                        RoundBarCastWellPublicThreadState = true;
                        break;
                    case "HydraulicSystemPage":
                        RoundBarHydraulicSystemThreadState = true;
                        break;
                    case "WaterSupplySystemPage":
                        RoundBarWaterSupplySystemThreadState = true;
                        break;
                    case "DrainageSystemPage":
                        RoundBarDrainageSystemThreadState = true;
                        break;
                    case "NetConnectPage":
                        RoundBarNetConnectPageThreadState = true;
                        break;
                }
            }
            else if (SystemConfig.equipmentCategory == "扁锭")
            {

            }
        }
    }
}
